package a66weding.com.jiehuntong.activity.home.hotel.shop;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import org.xutils.x;

import java.util.List;

import a66weding.com.jiehuntong.R;
import a66weding.com.jiehuntong.adapter.MyBaseAdapter;
import a66weding.com.jiehuntong.common.utils.ImageOptionsUtil;

/**
 * Created by admin on 2016/9/13.
 */
public class TuwenAdapter extends MyBaseAdapter {
    public TuwenAdapter(Context context, List data) {
        super(context, data);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
        ViewHodler viewHodler;
        if (convertView==null){
            viewHodler = new ViewHodler();
            convertView = View.inflate(context, R.layout.item_home_detail_content_leftheader,null);
            viewHodler.imageView = (ImageView) convertView.findViewById(R.id.iv_detail_leftitem);
            convertView.setTag(viewHodler);
        }else{
            viewHodler = (ViewHodler) convertView.getTag();
        }
        String url = (String) data.get(position);
        x.image().bind(viewHodler.imageView,url, ImageOptionsUtil.getOptions316_720());
        return convertView;
    }
    class ViewHodler{
        ImageView imageView;
    }
}
